package actions 
{
	import com.greensock.TweenLite;
	import core.App;
	import view.scene.Scene;
	/**
	 * ...
	 * @author Johnny Cheng
	 */
	public class ZoomAction 
	{
		
		public function ZoomAction(oldScene:Scene, newScene:Scene) 
		{
			if (oldScene == null) return;
			oldScene.mouseChildren = newScene.mouseChildren = false;
			
			newScene.visible = false;
			TweenLite.to(oldScene, 0.4, { scaleX:0, scaleY:0, x:App.stage.stageWidth * .5, y:App.stage.stageHeight * .5, onComplete:function():void {
				oldScene.removeSelf();
				oldScene.x = oldScene.y = 0;
				oldScene.scaleX = oldScene.scaleY = 1;
				TweenLite.from(newScene, 0.4, { scaleX:0, scaleY:0, x:App.stage.stageWidth * .5, y:App.stage.stageHeight * .5, onComplete:function():void { newScene.mouseChildren = true; } } );
				newScene.visible = true;
			}});
		}
		
	}

}